package com.iflytek.day05;

import java.util.Scanner;

// 2 3 5 7 质数
// 4 6 8 9 10 88 2*44 4*22
public class _09_Practice03 {
    public static void main(String[] args) {
        //1.键盘录入一个正整数
        //number
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个正整数");
        int number = sc.nextInt();//9

        boolean flag = true;

        for (int i = 2; i < number; i++) {

            if (number % i == 0) {// 9 % 2 = 1
                flag = false;
                break;
            }
        }

        if (flag) {
            System.out.println(number + "是一个质数");
        } else {
            System.out.println(number + "不是一个质数");
        }
    }
}
